package com.lq.schoolshop.controller;


import com.lq.schoolshop.bean.Result;
import com.lq.schoolshop.bean.StatusCode;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @Author
 * @Date2020/10/27 21:13
 * @Version V1.0
 * 为什么努力？想把钱都赚够，一心跳广场舞曲去。
 **/
@RestController
@CrossOrigin(origins = "*",maxAge = 3600)
@Api(value = "内置跳转接口",tags = "所有内测功能描述,请勿使用")
public class RequestLimitController {

    @ApiOperation(value = "内置跳转接口",notes = "内置跳转接口")
    @RequestMapping(value = "/requestLimit",method = RequestMethod.GET)
    public Result requestLimitTime(HttpServletRequest request) {
        //1分钟=60秒   1秒=60毫秒
        Object limitTime = request.getAttribute("remainingTime");
        //Long min = (Long)limitTime/1000/60;
        return new Result(false, StatusCode.OK,"访问频繁,IP已被限制，请稍后在试");
    }


}
